<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>
</head>
<body>
<form id="myform" action="" method="post">
    账号：<input type="text" name="username"><br/>
    密码：<input type="password" name="userpwd"><br/>
    <input id="btn" type="button" value="添加用户">
</form>

<script>
    $("#btn").click(function () {
        $.post({
            url:'xulie.do',
            data:$("#myform").serialize(),
            success:function (result) {
                console.log(result);
            }
        });
    });

</script>
</body>
</html>